import pymysql
from fastapi import FastAPI,Form,HTTPException

app = FastAPI()
@app.post("/ck")
def ck(id:str=Form(...),
       status:str=Form(...)):
    # 链接数据库
    sjk = pymysql.Connection(user='root',password='Rc123456.',database='1111a')
    # 创建操作对象
    ykq = sjk.cursor()
    # 创建aq语句
    ykq.execute("update qqfc set status=%s where id=%s",(status,id))
    # 提交语句
    sjk.commit()
    # 关闭数据库
    sjk.close()
    # 提示修改成功
    return {"user":"修改成功"}
